package example.com.dynamicproxy;

import android.app.Activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;

//http://www.jb51.net/article/79799.htm
public class NormalLaunchActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_normal_launch);
        findViewById(R.id.getCurrentActivity).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
               Activity activity =  ActivityUtil.getActivity();
                if (activity!=null){
                    Toast.makeText(NormalLaunchActivity.this,activity.getClass().getName(), Toast.LENGTH_SHORT).show();
                }
            }
        });
    }
}
